package com.lancoo.ccas52.util;

import lombok.AllArgsConstructor;

/**
 * 自定义异常码
 *
 * @author quin.song
 * @since 2022-03-20
 */
@AllArgsConstructor
public enum EnumResultCode {

    // 数据操作错误定义
    SUCCESS(0, "success"),
    INVALID_TOKEN(1, "invalid token"),
    CUSTOM_EXCEPTION(2, ""),
    PARAMS_ERROR(3, "param error"),
    NO_POWER(4,"no power!"),
    DATA_DUPLICATION(5,"data duplication!"),
    FAIL(999, "fail");

//    SUCCESS(200, "成功!"),
//    BODY_NOT_MATCH(400,"请求的数据格式不符!"),
//    SIGNATURE_NOT_MATCH(401,"请求的数字签名不匹配!"),
//    NOT_FOUND(404, "未找到该资源!"),
//    FAIL(500, "服务器内部错误!"),
//    SERVER_BUSY(503,"服务器正忙，请稍后再试!");

    /** 错误码 */
    private Integer code;

    /** 错误描述 */
    private String resultMsg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }
}
